import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

var user={};
const state={
    userInfo:sessionStorage.getItem("userInfo")==null?{}:JSON.parse(sessionStorage.getItem("userInfo"))
}
const mutations={
    SAVE_USERINFO(state,userInfo){
        sessionStorage.setItem("userInfo",JSON.stringify(userInfo));
        state.userInfo=userInfo;
       //  user=JSON.parse(sessionStorage.getItem("userInfo"));

     
    }
}
export default new Vuex.Store({
    state,
    mutations
})